﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.FactoryManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.FactoryManagement.LineShiftVMs
{
    public partial class LineShiftTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._LineShift._Name")]
        public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.Name);
        [Display(Name = "_Model._LineShift._Code")]
        public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.Code);
        [Display(Name = "_Model._LineShift._StartTime")]
        public ExcelPropety StartTime_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.StartTime, true);
        [Display(Name = "_Model._LineShift._EndTime")]
        public ExcelPropety EndTime_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.EndTime, true);
        [Display(Name = "_Model._LineShift._Hours")]
        public ExcelPropety Hours_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.Hours);
        [Display(Name = "_Model._LineShift._CrossDays")]
        public ExcelPropety CrossDays_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.CrossDays);
        [Display(Name = "_Model._LineShift._Line")]
        public ExcelPropety Line_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.LineId);
        [Display(Name = "_Model._LineShift._LineName")]
        public ExcelPropety LineName_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.LineName);
        [Display(Name = "_Model._LineShift._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.CreateTime, true);
        [Display(Name = "_Model._LineShift._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.UpdateTime, true);
        [Display(Name = "_Model._LineShift._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.CreateBy);
        [Display(Name = "_Model._LineShift._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.UpdateBy);
        [Display(Name = "_Model._LineShift._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.IsValid);
        [Display(Name = "_Model._LineShift._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<LineShift>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Line_Excel.DataType = ColumnDataType.ComboBox;
            Line_Excel.ListItems = DC.Set<ProductionLine>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class LineShiftImportVM : BaseImportVM<LineShiftTemplateVM, LineShift>
    {
            //import

    }

}